# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-emcee
pkgver=3.1.4
pkgrel=0
pkgdesc="Python ensemble sampling toolkit for affine-invariant MCMC"
url="https://github.com/dfm/emcee"
arch="noarch !x86 !armhf !armv7"
license="MIT"
depends="
	py3-numpy
	"
makedepends="
	py3-gpep517
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="
	py3-h5py
	py3-pytest-cov
	py3-pytest-xdist
	py3-scipy
	"
subpackages="$pkgname-pyc"
source="https://github.com/dfm/emcee/archive/v$pkgver/emcee-$pkgver.tar.gz"
builddir="$srcdir/emcee-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	rm -r "$pkgdir"/usr/lib/python*/site-packages/emcee/tests
}

sha512sums="
9c6c22c7854438e7951c7bccefca21159945405cba05f52e0b99563e651789475d7342226f63c8a2e8250fd25287064ca095ea961427e6ac15ceb217d3dbb174  emcee-3.1.4.tar.gz
"
